CentOS 6
Sponsored Link

OpenStack Icehouse : Configure Swift#3 (Storage Node)
2014/06/28
 
Configure OpenStack Object Storage (Swift).
This example shows to configure like the environment below.
                                    |
     +------------------+           |           +-----------------+
     | [ Control Node ] |10.0.0.30  |  10.0.0.70|  [ Proxy Node ] |
     |     Keystone     |-----------+-----------|                 |
     +------------------+           |           +-----------------+
                                    |
        +---------------------------+--------------------------+
        |                           |                          |
        |10.0.0.71                  |10.0.0.72                 |10.0.0.73 
+-------+----------+       +--------+---------+       +--------+---------+
| [Storage Node#1] |       | [Storage Node#2] |       | [Storage Node#3] |
|                  |-------|                  |-------|                  |
+------------------+       +------------------+       +------------------+

 
Configure Storage Node on this section. It's OK to set the same settings mostly on all Storage Nodes,
but only IP address and Device number are different each other, though. Furthermore, add Hard drives on each Storage Nodes and create a partition "/dev/sdb1" for this settings.
[1] Install Swift-Account, Swift-Container, Swift-Object and others on all Storage Node like follows.
# install from RDO, EPEL

[root@node01 ~]#
yum --enablerepo=openstack-icehouse,epel -y install openstack-swift-account openstack-swift-container openstack-swift-object xfsprogs xinetd rsync openssh-clients
[2] Format free space of disk (/dev/sdb1 on this example) with XFS and mount on srv/node on allStorage Node like follows. (the number "device*" is different on each Storage Nodes)
[root@node01 ~]#
mkfs.xfs -i size=1024 -s size=4096 /dev/sdb1

meta-data=/dev/sdb1              isize=1024   agcount=4, agsize=6553514 blks
         =                       sectsz=4096  attr=2, projid32bit=0
data     =                       bsize=4096   blocks=26214055, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0
log      =internal log           bsize=4096   blocks=12799, version=2
         =                       sectsz=4096  sunit=1 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

[root@node01 ~]#
mkdir -p /srv/node/device0

[root@node01 ~]#
mount -o noatime,nodiratime,nobarrier /dev/sdb1 /srv/node/device0

[root@node01 ~]#
chown -R swift. /srv/node

[root@node01 ~]#
vi /etc/fstab
# add at the last line

/dev/sdb1               /srv/node/device0       xfs     noatime,nodiratime,nobarrier 0 0
[3] Copy Swift Ring files from the Swift Proxy Node to all Storage Nodes.
[root@proxy ~]#
scp /etc/swift/*.gz 10.0.0.71:/etc/swift/

root@10.0.0.71's password:
account.ring.gz                    100% 3912     3.8KB/s   00:00
container.ring.gz                  100% 3904     3.8KB/s   00:00
object.ring.gz                     100% 3895     3.8KB/s   00:00
[4] Change ownership for Swift Ring files on all Storage Nodes.
[root@node01 ~]#
chown swift. /etc/swift/*.gz

[5] Configure Swift and Rsync on all Storage Nodes.
[root@node01 ~]#
vi /etc/swift/swift.conf
# set the value which is set on Proxy Node

[swift-hash] swift_hash_path_suffix =
swift_shared_path
[root@node01 ~]#
vi /etc/swift/account-server.conf
# line 2: change to the own IP address

bind_ip =
10.0.0.71
[root@node01 ~]#
vi /etc/swift/container-server.conf
# line 2: change to the own IP address

bind_ip =
10.0.0.71
[root@node01 ~]#
vi /etc/swift/object-server.conf
# line 2: change to the own IP address

bind_ip =
10.0.0.71
[root@node01 ~]#
vi /etc/rsyncd.conf
# create new like follows (replace the IP to your server's one)

pid file = /var/run/rsyncd.pid
log file = /var/log/rsyncd.log
uid = swift
gid = swift
address = 10.0.0.71

[account]
path            = /srv/node
read only       = false
write only      = no
list            = yes
incoming chmod  = 0644
outgoing chmod  = 0644
max connections = 25
lock file =     /var/lock/account.lock

[container]
path            = /srv/node
read only       = false
write only      = no
list            = yes
incoming chmod  = 0644
outgoing chmod  = 0644
max connections = 25
lock file =     /var/lock/container.lock

[object]
path            = /srv/node
read only       = false
write only      = no
list            = yes
incoming chmod  = 0644
outgoing chmod  = 0644
max connections = 25
lock file =     /var/lock/object.lock

[swift_server]
path            = /etc/swift
read only       = true
write only      = no
list            = yes
incoming chmod  = 0644
outgoing chmod  = 0644
max connections = 5
lock file =     /var/lock/swift_server.lock
[6] Start Swift services.
[root@node01 ~]#
chkconfig rsync on

[root@node01 ~]#
chkconfig xinetd on

[root@node01 ~]#
/etc/rc.d/init.d/xinetd start

Starting xinetd: [ OK ]
[root@node01 ~]#
for ringtype in account container object; do
    /etc/rc.d/init.d/openstack-swift-$ringtype start
    chkconfig openstack-swift-$ringtype on
    for service in replicator updater auditor; do
        if [ $ringtype != 'account' ] || [ $service != 'updater' ]; then
            /etc/rc.d/init.d/openstack-swift-$ringtype-$service start
            chkconfig openstack-swift-$ringtype-$service on
        fi
    done
done 
Starting openstack-swift-account:                          [  OK  ]
Starting openstack-swift-account-replicator:               [  OK  ]
Starting openstack-swift-account-auditor:                  [  OK  ]
Starting openstack-swift-container:                        [  OK  ]
Starting openstack-swift-container-replicator:             [  OK  ]
Starting openstack-swift-container-updater:                [  OK  ]
Starting openstack-swift-container-auditor:                [  OK  ]
Starting openstack-swift-object:                           [  OK  ]
Starting openstack-swift-object-replicator:                [  OK  ]
Starting openstack-swift-object-updater:                   [  OK  ]
Starting openstack-swift-object-auditor:                   [  OK  ]
 
Tweet